﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Cipher.CMS.admin
{
    public partial class add_post : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void SaveButton_Click(object sender, EventArgs e)
        {
            string ConnectionString=@"Data Source=.\sqlexpress;Initial Catalog=CipherDb;Integrated Security=True";
            SqlConnection Connection = new SqlConnection(ConnectionString);
            Connection.Open();
            string SqlText="Insert into Post (PostTitle,PostBody) values (" +"'" + TextBox1.Text + "'"+","+"'"+ TextBox2.Text+"'"+")";
            SqlCommand Command = new SqlCommand(SqlText, Connection);
            Command.ExecuteNonQuery();
        }
    }
}